package ch.jamme.model.rel1;

import java.lang.reflect.*;

public class ItemProxy implements InvocationHandler {
	
	private Item item;
	
	private ItemProxy(Item item) {
		this.item = item;
	}

	public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
		return method.invoke(item, args);
	}

	public static Item proxy(Item item) {
		return (Item)Proxy.newProxyInstance(item.getClass().getClassLoader(), new Class[] {Item.class}, new ItemProxy(item));
	}
}
